package com.xxx.servlet;

import com.xxx.pojo.Student;
import com.xxx.service.StudentServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/8/5 16:07
 * @Copyright 博为峰
 */
@WebServlet("/stu")
public class StudentServlet extends BaseServlet {

    public String queryStudents(HttpServletRequest req, HttpServletResponse resp) {
        final StudentServiceImpl studentService = new StudentServiceImpl();
        final ArrayList<Student> list = studentService.queryStudents();
        req.setAttribute("list", list);
        return "forward:/stu_list.jsp";
    }
}
